<template>
  <div class="agent__list_item cursor mb-10" @click="clickHandle(item)">
    <img class="agent__icon" :src="item.icon" alt="" />
    <div class="agent__info">
      <p class="fs-12 fs-b mb-6">{{ item.name || item.title }}</p>
      <p class="desc fs-12">{{ item.desc }}</p>
    </div>
  </div>
</template>

<script>
export default {
  name: 'PopAgentItem',
  inject: ['clickAgentItem'],
  data () {
    return {
    }
  },
  props: {
    item: {
      type: Object,
      default: () => {}
    },
    isStar: {
      type: Boolean,
      default: () => false
    }
  },
  methods: {
    clickHandle (item) {
      if (!this.isStar) {
        this.$xz('HtmlClickReport', { ReportID: 7624 })
      }
      this.clickAgentItem(item, true)
    }
  }
}
</script>

<style lang="scss" scoped>
.agent__list_item {
  height: 62px;
  padding: 0 20px;
  background: rgba(255,255,255,0.1);
  border-radius: 10px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 12px;
  box-sizing: border-box;
  overflow: hidden;
  &:hover {
    background: rgba(255,255,255,0.15);
  }
}
.agent__icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
}
.agent__info {
  flex: 1 1 auto;
  line-height: 16px;
  flex: 1 1 100%;
  width: calc(100% - 42px);
  .desc {
    color: rgba(255,255,255,0.7);
    line-height: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
</style>
